package com.moss.cloud.base.api.model.from;

import com.moss.cloud.common.core.constant.Regular;
import com.moss.cloud.common.core.exception.SystemErrorType;
import com.moss.cloud.common.core.utils.BooleanHandel;
import com.moss.cloud.common.core.utils.GenUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

@Slf4j
@Data
public class UpdateUserForm implements Serializable {
    /**
     * 用户姓名
     */
    @NotBlank(message = "昵称不能为空")
    @Size(max = 32, message = "昵称最大32位")
    private String name;
    /**
     * 用户手机
     */
    @NotBlank(message = "手机号不能为空")
    @Size(min = 6, max = 11, message = "手机号最小6位，最大11位")
    private String mobile;
    /**
     * 用户邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(regexp = Regular.EMAIL_REG, message = "邮箱格式错误")
    private String email;
    /**
     * 用户头像
     */
    @NotBlank(message = "头像不能为空")
    @Size(max = 225, message = "头像最大长度不能超过225位")
    @Pattern(regexp = Regular.IMG_REG,message = "头像格式错误")
    private String avatar;
    /**
     * 用户性别（0男，1女，2未知，3双性）
     */
    @NotNull(message = "性别不能为空")
    @Min(value = 0,message = "性别格式错误")
    @Max(value = 3,message = "性别格式错误")
    private Integer sex;
    /** 生日*/
    @NotNull(message = "生日不能为空")
    private LocalDate birthday;

    /** 简介*/
    @Size(max = 300, message = "简介不能超过300个字符")
    private String description;

}
